# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1291186157.5145509
_template_filename=u'/Users/joeldunham/old/onlinelinguisticdatabase/templates/derived/file/addUpdateFields.html'
_template_uri=u'/derived/file/addUpdateFields.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['fileUpload', 'unalterableData', 'update', 'add', 'generalInfo', 'recordingInfo']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    # SOURCE LINE 14
    ns = runtime.Namespace(u'fileViews', context._clean_inheritance_tokens(), templateuri=u'/base/fileViews.html', callables=None, calling_uri=_template_uri, module=None)
    context.namespaces[(__name__, u'fileViews')] = ns

def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        _import_ns = {}
        _mako_get_namespace(context, u'fileViews')._populate(_import_ns, [u'displayFile'])
        __M_writer = context.writer()
        # SOURCE LINE 5
        __M_writer(u'\n\n')
        # SOURCE LINE 11
        __M_writer(u'\n\n')
        # SOURCE LINE 22
        __M_writer(u'\n\n')
        # SOURCE LINE 34
        __M_writer(u'\n\n')
        # SOURCE LINE 46
        __M_writer(u'\n\n')
        # SOURCE LINE 72
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_fileUpload(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'fileViews')._populate(_import_ns, [u'displayFile'])
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 24
        __M_writer(u'\n<fieldset>\n<legend>File</legend>\n<ol>\n <li>\n  <label for="fileData">Upload * <span class="emphasize">(text, image, audio or video)</span></label><br />\n  ')
        # SOURCE LINE 30
        __M_writer(escape(h.file('fileData', tabindex=1)))
        __M_writer(u'\n </li>\n</ol>\n</fieldset>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_unalterableData(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'fileViews')._populate(_import_ns, [u'displayFile'])
        c = _import_ns.get('c', context.get('c', UNDEFINED))
        app_globals = _import_ns.get('app_globals', context.get('app_globals', UNDEFINED))
        displayFile = _import_ns.get('displayFile', context.get('displayFile', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 13
        __M_writer(u'\n')
        # SOURCE LINE 14
        __M_writer(u'\n<br />')
        # SOURCE LINE 15
        __M_writer(escape(c.file.name))
        __M_writer(u'\n')
        # SOURCE LINE 16
        if app_globals.allowedFileTypes[c.file.MIMEtype]:
            # SOURCE LINE 17
            __M_writer(u'    ')
            fileType = app_globals.allowedFileTypes[c.file.MIMEtype] 
            
            __M_writer(u'\n')
            # SOURCE LINE 18
        else: 
            # SOURCE LINE 19
            __M_writer(u'    ')
            fileType = c.file.MIMEtype.split('/')[0] 
            
            __M_writer(u'\n')
            pass
        # SOURCE LINE 21
        __M_writer(escape(displayFile(c.file, fileType)))
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_update(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'fileViews')._populate(_import_ns, [u'displayFile'])
        self = _import_ns.get('self', context.get('self', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 7
        __M_writer(u'\n ')
        # SOURCE LINE 8
        __M_writer(escape(self.unalterableData()))
        __M_writer(u'\n ')
        # SOURCE LINE 9
        __M_writer(escape(self.generalInfo()))
        __M_writer(u'\n ')
        # SOURCE LINE 10
        __M_writer(escape(self.recordingInfo()))
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_add(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'fileViews')._populate(_import_ns, [u'displayFile'])
        self = _import_ns.get('self', context.get('self', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n ')
        # SOURCE LINE 2
        __M_writer(escape(self.fileUpload()))
        __M_writer(u'\n ')
        # SOURCE LINE 3
        __M_writer(escape(self.generalInfo()))
        __M_writer(u'\n ')
        # SOURCE LINE 4
        __M_writer(escape(self.recordingInfo()))
        __M_writer(u'\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_generalInfo(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'fileViews')._populate(_import_ns, [u'displayFile'])
        __M_writer = context.writer()
        # SOURCE LINE 36
        __M_writer(u'\n<fieldset>\n<legend>General Info</legend>\n<ol>\n <li>\n  <label for="description">Description</label>\n  <textarea id="description" name="description" rows="2" cols="10" tabindex="2"></textarea>\n </li>\n</ol>\n</fieldset>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_recordingInfo(context):
    context.caller_stack._push_frame()
    try:
        _import_ns = {}
        _mako_get_namespace(context, u'fileViews')._populate(_import_ns, [u'displayFile'])
        h = _import_ns.get('h', context.get('h', UNDEFINED))
        app_globals = _import_ns.get('app_globals', context.get('app_globals', UNDEFINED))
        __M_writer = context.writer()
        # SOURCE LINE 48
        __M_writer(u'\n<fieldset>\n<legend>Recording-specific Info</legend>\n<ol>\n <li>\n  <label for="speaker">Speaker</label>\n  ')
        # SOURCE LINE 54
        speakers = [('', '')] + app_globals.speakers 
        
        __M_writer(u'\n  ')
        # SOURCE LINE 55
        __M_writer(escape(h.select(name='speaker', selected_values="", options=speakers, tabindex=3)))
        __M_writer(u'\n </li>\n <li>\n  <label for="elicitor">Elicitor</label>\n  ')
        # SOURCE LINE 59
        users = [('', '')] + app_globals.users 
        
        __M_writer(u'\n  ')
        # SOURCE LINE 60
        __M_writer(escape(h.select(name='elicitor', selected_values="", options=users, tabindex=4)))
        __M_writer(u'\n </li>\n <li>\n  <label for="dateElicited">Date Elicited (MM/DD/YYYY)</label>\n  <input id="dateElicited" maxlength="10" name="dateElicited" tabindex="5" type="text" />\n </li>\n <li>\n  <label for="utteranceType">Utterance Type</label>\n  ')
        # SOURCE LINE 68
        __M_writer(escape(h.select(name='utteranceType', selected_values="None", options=[('', 'None'), 'Object Language Utterance', 'Metalanguage Utterance', 'Mixed Utterance'], tabindex=5)))
        __M_writer(u'\n </li>\n</ol>\n</fieldset>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


